import React from 'react'
import './index.scss'

export default class Map extends React.Component {
  componentDidMount(){
    //在react中全局对象需要使用window来访问，否则eslint会报错
    const map = new window.BMapGL.Map('container')
    const point = new window.BMapGL.Point(116.404, 39.915);
    map.centerAndZoom(point, 15);
  }
  render() {
    return (<div className='map'>
      <div id="container" />
    </div>)
  }
}